//服务器地址
import {server} from '../config/index.js';

castapp.init();
mui.init();
mui.plusReady(function(){
	//按手机返回键
	var lastTime = Date.now();
	mui.back = function(){
		var now = Date.now();
		if(now - lastTime <500){ //两次时间间隔不超过500毫秒
			plus.runtime.quit();
		}else{
			castapp.prompt('再按一次退出程序');
			lastTime = now;
		}
	}
});

var $liElems = $('.me-list li.mui-table-view-cell');

//点击个人信息
$liElems.eq(0).get(0).addEventListener('tap',function(e){
	e.preventDefault();
	castapp.newInterface({
		url: './person_info.html',
		id: 'person_info',
		show: {
			autoShow: false,
			aniShow: 'zoom-fade-out',
			duration: '350'
		},
		waiting: {
			autoShow: true,
			title:'加载中...'
		}
	});
});


//点击二维码名片
$liElems.eq(1).get(0).addEventListener('tap',function(e){
	e.preventDefault();
	castapp.newInterface({
		url: './QR_code.html',
		id: 'QR_code'
	});
});

//点击设置
$liElems.eq(2).get(0).addEventListener('tap',function(e){
	e.preventDefault();
	castapp.newInterface({
		url: './setting.html',
		id: 'setting'
	});
});

//点击关于我们
$liElems.eq(3).get(0).addEventListener('tap',function(e){
	e.preventDefault();
	castapp.newInterface({
		url: './about.html',
		id: 'about'
	});
});